require("../../26C7E8E6875DE5CF40A180E17E6D6824.js");

Page({
    data: {
        aihistory: [],
        hideImageList: []
    },
    onLoad: function(t) {
        var i = (wx.getStorageSync("aihistory") || []).map(function(t, i) {
            if (null != t.aiResultStr) {
                var a = t.aiResultStr, o = JSON.parse(a);
                if (null != o[0] && null != o[0].name) return t.firstname = o[0].name, t.show = !0, 
                t;
            }
        });
        console.log(i), this.setData({
            aihistory: i
        });
    },
    onReady: function() {},
    onShow: function() {
        console.log("history.onshow");
    },
    cleanHistory: function() {
        var t = this;
        wx.clearStorage(), wx.showToast({
            title: "清理缓存完成",
            success: function() {
                t.setData({
                    aihistory: []
                });
            }
        });
    },
    tapHistoryDetail: function(t) {
        console.log("history.detail", t);
        var i = t.currentTarget.dataset;
        wx.navigateTo({
            url: "/pages/detail/detail?from=history&type=" + i.type + "&filePath=" + i.imgurl + "&aiResultStr=" + i.airesultstr
        });
    },
    hideImage: function(t) {
        var i = t.currentTarget.dataset.imgindex;
        console.log("delImgIndex:", i), this.data.hideImageList.push(i);
        var a = this.data.aihistory;
        a.splice(i, 1), console.log("result history:", a), wx.setStorageSync("aihistory", a), 
        this.setData({
            aihistory: a
        });
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});